public class Test {
    public static void main(String[] args) {
        MyTreeNode myTreeNode = new MyTreeNode();
        MyTreeNode.TreeNode root = myTreeNode.createTree();

        System.out.print("前序： ");
        myTreeNode.preOrder(root);
        System.out.println();

        System.out.println("================");

        System.out.print("中序： ");
        myTreeNode.inOrder(root);
        System.out.println();

        System.out.println("================");

        System.out.print("后序： ");
        myTreeNode.postOrder(root);
        System.out.println();

        System.out.println("================");

        myTreeNode.size(root);
        System.out.println("节点个数：" + myTreeNode.count);

        System.out.println("================");

        myTreeNode.nodeSize(root);
        System.out.println("节点个数：" + myTreeNode.count);

        System.out.println("================");

        myTreeNode.getLeafNodeCount(root);
        System.out.println("叶节点个数： " + MyTreeNode.leafCount);

        System.out.println("================");

        int count = myTreeNode.getLeafNodeCount2(root);
        System.out.println("叶节点个数： " + count);

        System.out.println("================");

        int kLevelNodeCount = myTreeNode.getKLevelNodeCount(root,3);
        System.out.println("第K层的节点个数： " + kLevelNodeCount);

        System.out.println("================");

        int height = myTreeNode.getHeight(root);
        System.out.println("树的高度： " + height);

        System.out.println("================");
        System.out.print("层序遍历： ");
        myTreeNode.levelOrder(root);
    }

}
